<ion-header>
  <ion-navbar>
    <ion-title>聊天室</ion-title>
  </ion-navbar>
</ion-header>
<ion-content class="page-container">
  <div *ngFor="let message of messages" [ngClass]="{'other': message.id != user.id, 'messages': true }">
    <div class="message-container">
      <div class="time">{{message.username}}</div>
      <div class="message">
        <span>{{message.message}}</span>
      </div>
    </div>
  </div>
</ion-content>
<ion-footer>
  <ion-toolbar>
    <ion-input type="text" placeholder="请输入你的消息" (keyup.enter)="sendMessage()" [(ngModel)]="inputMessage">
    </ion-input>
    <button color="primary" ion-button clear (click)="sendMessage()">
      发送
    </button>
  </ion-toolbar>
</ion-footer>

